#include <stdio.h>
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
#include <stdlib.h>

int main(void)
{
    struct timeval time_now;
    struct timezone zone;
    if (gettimeofday(&time_now, &zone) < 0) {
        perror("get time of day error");
    }
    printf("%ld  %ld\n", time_now.tv_sec, time_now.tv_usec);
    printf("%ld\n", time(NULL));
    printf("%d  %d\n", zone.tz_minuteswest, zone.tz_dsttime);

    return 0;
}
